package Reflect;

import org.testng.annotations.Test;

public class ReflectDemo {
    @Test
    public void demo1() throws InstantiationException, IllegalAccessException {
        Class rec = null;
        try {
           rec=Class.forName("OOP.Rectangle");
        } catch (ClassNotFoundException e) {
            System.err.println("没找到类");
        }
        Object rectangle = rec.newInstance();
        System.out.println(rectangle);
    }
}
